﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Account/NewAccountMasterPage.Master" AutoEventWireup="true" CodeBehind="ChangePassword.aspx.cs" Inherits="AteneoLibri.Account.ChangePassword" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Cambia password</h2>
    <p>
            La password deve avere un minimo di
            <%= System.Configuration.ConfigurationManager.AppSettings["minRequiredPasswordLength"] %>
            ed un massimo di
            <%= System.Configuration.ConfigurationManager.AppSettings["maxRequiredPasswordLength"] %>
            caratteri.
        </p>

    <div style="width: 100%; overflow: auto;">
            <div id="leftRegistration" class="Registration">
                <div>
                    Inserisci password attuale<br />
                    <asp:TextBox ID="txtOldPassword" runat="server" CssClass="StandardTextBox" TextMode="Password"></asp:TextBox>
                    <asp:CustomValidator ID="cvUserPassword" runat="server" ErrorMessage="(*) La password inserita non corrisponde con quella attuale!"
                        ValidationGroup="vgRec" Display="Dynamic" ControlToValidate="txtOldPassword">(*)</asp:CustomValidator>
                    <asp:RequiredFieldValidator ID="rfvOldPsw" runat="server" ErrorMessage="* Campo obbligatorio"
                        ValidationGroup="vgRec" ControlToValidate="txtOldPassword" Display="Dynamic" CssClass="failureNotification">*</asp:RequiredFieldValidator>
                </div>
                <div>
                    Nuova password<br />
                    <asp:TextBox ID="txtPassword" runat="server" CssClass="StandardTextBox" TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvPassword" runat="server" ErrorMessage="* Campo password obbligatorio"
                        ValidationGroup="vgRec" ControlToValidate="txtPassword" Display="Dynamic" CssClass="failureNotification">*</asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revPassword" runat="server" ErrorMessage="** La password non rispetta i requisiti minimi"
                        ValidationGroup="vgRec" ValidationExpression="[\W\s\w\S]{6,15}" Display="Dynamic"
                        ControlToValidate="txtPassword" CssClass="failureNotification" EnableClientScript="true">**</asp:RegularExpressionValidator>
                </div>
                <div>
                    Conferma nuova password<br />
                    <asp:TextBox ID="txtConfirmPsw" runat="server" CssClass="StandardTextBox" TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvConfirmPsw" runat="server" ErrorMessage="* Necessaria password di conferma"
                        ValidationGroup="vgRec" ControlToValidate="txtConfirmPsw" Display="Dynamic" CssClass="failureNotification">*</asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="cvPassword" runat="server" ErrorMessage="*** La password di conferma deve coincidere con la password"
                        ValidationGroup="vgRec" ControlToCompare="txtPassword" ControlToValidate="txtConfirmPsw"
                        Display="Dynamic" CssClass="failureNotification">***</asp:CompareValidator>
                </div>      
            </div>
            <div id="rightRegistration" class="Registration">                          
            </div>
        </div>
        <div style="text-align: center; margin-top: 20px;">
            <asp:Button ID="btnChangePassword" runat="server" CssClass="StandardButton" Text="Cambia password"
                ValidationGroup="vgRec" onclick="btnChangePassword_Click" />&nbsp;
            <asp:Button ID="btnAnnulla" runat="server" CssClass="StandardButton" Text="Annulla"
                CausesValidation="false" onclick="btnAnnulla_Click" />
        </div>
        <div class="ValidationBox">
            <asp:ValidationSummary ID="vsRegistrazione" runat="server" DisplayMode="BulletList"
                ValidationGroup="vgRec" CssClass="failureNotification" EnableClientScript="true"
                HeaderText="Attenzione:" />
        </div>
</asp:Content>
